package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description :
 * @Date : 2022/10/18 14:18
 * @Modified by : zjf
 */
public enum BasicElectricity implements EnumMethod{

    NOTHING(0,"无"),
    TRANSFORMER_CAPACITY(1,"变压器容量计算"),
    MAXIMUM_DEMAND(2,"最大需量计算"),
    ;

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    BasicElectricity(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getDescFromCode(int code){
        for(BasicElectricity type: BasicElectricity.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

}
